import App from './App'

import {api} from './util/api.js'  // API 链接
import {post,get,put,DELETE} from './util/http.js' // 请求方式中间件

Vue.prototype.$post=post;
Vue.prototype.$get=get;
Vue.prototype.$put=put;
Vue.prototype.$delete=DELETE;
Vue.prototype.$api = api;

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App
})
app.$mount()
// #endif

// 封装弹框的方法
uni.$showMsg = function(title = '数据请求失败！', duration = 1500) {
  uni.showToast({
    title,
    duration,
    icon:'none',
  })
}

import uView from '@/uni_modules/uview-ui'
Vue.use(uView)

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif